
import 'package:flutter/material.dart';
import 'package:rainflutter/Tools/dcp_pch.dart';


class NotiClass extends StatefulWidget {
  @override
  _NotiClassState createState() => _NotiClassState();
}

class _NotiClassState extends State<NotiClass>
    with SingleTickerProviderStateMixin {
  AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('测试通知'),
          centerTitle: true,
        ),
        body: Container(
          color: Colors.white,
          child: Column(
            children: <Widget>[
              FlatButton(
            child: Text('点我发1通知'),
            onPressed: (){
              print('dianledianle1');
              NotificationCenter.post('NotificationName1', 'param value1');
            },
          ),FlatButton(
            child: Text('点我发2通知'),
            onPressed: (){
              print('dianledianle2');
              NotificationCenter.post('NotificationName2', 'param value2');
            },
          ),
            ],
          )
        ));
  }
}